home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-02-13 | 2.5 KB | 132 lines | [TEXT/MPS ] |
- // UMouseTrackBehavior.h
- // Copyright © 1992 by Apple Computer, Inc. All rights reserved.
- // Kent Sandvik DTS
- // This file contains the basic TMouseTrackBehavior class definitions
- // Version Info (latest first):
- //
- // <1> khs 1.0 First final version
- // <2> khs 1.0.1 Fixed a memory leak in TMapApplication::GetSleepValue()
-
-
- #ifndef __UMOUSETRACKBEHAVIOR__
- #define __UMOUSETRACKBEHAVIOR__
-
-
- #ifndef __UBEHAVIOR__
- #include <UBehavior.h>
- #endif
-
- #ifndef __UFLOATWINDOW__
- #include <UFloatWindow.h>
- #endif
-
- #ifndef __UMENUMGR__
- #include <UMenuMgr.h>
- #endif
-
- #ifndef __UFLOATWINDOW__
- #include <UFloatWindow.h>
- #endif
-
- #ifndef __UDIALOG__
- #include <UDialog.h>
- #endif
-
- #ifndef __UDIALOGBEHAVIOR__
- #include <UDialogBehavior.h>
- #endif
-
- #ifndef __UVIEWSERVER__
- #include <UViewServer.h>
- #endif
-
- #ifndef __PACKAGES__
- #include <Packages.h>
- #endif
-
- #ifndef __RESOURCECONSTANTS__
- #include "ResourceConstants.h"
- #endif
-
- // FORWARD STATEMENTS
- class TMouseTrackBehavior;
- class TSwallowBehavior;
- class TTrackWindow;
-
-
- // GLOBALS
- const IDType kMouseTrackBehavior = 'MTRB';
-
- TTrackWindow* gMouseTrackWindow = NULL; // global TrackWindow hook (one and only)
-
- void InitMouseTrackBehavior(); // initialize our nice behavior (called once)
-
-
- // CLASSES
- // floating window used for presentation of the mouse information
- DeclareClassDesc(TTrackWindow);
-
- class TTrackWindow : public TFloatWindow
- {
-
- DeclareClass(TTrackWindow);
-
- public:
- virtual void Close();
- virtual void GetOriginatorBehavior(TSwallowBehavior*);
-
- TSwallowBehavior* fBehavior;
- };
-
-
- // our event swallow behavior, swallows everything
- DeclareClassDesc(TSwallowBehavior);
-
- class TSwallowBehavior : public TBehavior
- {
-
- DeclareClass(TSwallowBehavior);
-
- public:
- virtual void ISwallowBehavior();
- virtual Boolean DoToolboxEvent(TToolboxEvent* event);
- virtual void Draw(const VRect& area);
-
- // FIELDS
- TTrackWindow* fTrackWindow;
- TStaticText* fMouseStatus;
- TStaticText* fVertical;
- TStaticText* fHorizontal;
- VPoint fMouseVPoint;
- short fEventType;
- };
-
-
- // the main behavior, which will coordinate swallow behavior and other objects
- DeclareClassDesc(TMouseTrackBehavior);
-
- class TMouseTrackBehavior : public TBehavior
- {
-
- DeclareClass(TMouseTrackBehavior);
-
- public:
- virtual void IMouseTrackBehavior(ResNumber menuID);
- TMouseTrackBehavior();
-
- virtual void DoSetupMenus();
- virtual void DoMenuCommand(CommandNumber);
- virtual void CreateSwallowBehavior();
- virtual void CreateWindoid();
-
- // FIELDS
- short fMenuID;
- TTrackWindow* fWindoid;
- };
-
-
-
-
- #endif
-
-